<!DOCTYPE html>
<html>
<head>
    <title>投递记录</title>
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link href="/font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css" rel="stylesheet">


    <link rel='stylesheet' href='/stylesheets/common.css'/>
    <!--<link rel='stylesheet' href='/js/bootstrap.min.js'/>-->
</head>
<body>
<% include header.ejs %>
<div class="main container">
    <div class="col-md-2 p-w-xxs">
        <div class="drop-menu menu">
            <ul>
                <li class="menu-title"><a class="h4 text-left">简历管理</a></li>
                <li>
                    <a href="/post/rece" class="m-post-rece">收到的简历</a>
                </li>
                <li>
                    <a href="/post/saw" class="m-post-saw">被查看简历</a>
                </li>
                <li>
                    <a href="/post/sx" class="m-post-sx">待筛选简历</a>
                </li>
                <li>
                    <a href="/post/invite" class="m-post-invite">已邀请面试</a>
                </li>
                <li>
                    <a href="/post/dismatch" class="m-post-dismatch">不匹配简历</a>
                </li>
                <li>
                    <a href="/post/mark" class="m-post-mark">收藏的简历</a>
                </li>

            </ul>
        </div>

    </div>
    <div class="col-md-10 main-right">
        <div class="row  text-center p-sm" style="background:#00b58c">
            <div class="space-30"></div>
            <div class="col-md-3 " style="border-right:1px solid #4acbac">
                <a class="text-white h2" href="">{{arcount}}</a>

                <p class="text-white h4">已收到的简历</p>
            </div>
            <div class="col-md-3" style="border-right:1px solid #4acbac">
                <a class="text-white h2" href="">{{arcount3}}</a>

                <p class="text-white h4">邀请面试</p>
            </div>
            <div class="col-md-3" style="border-right:1px solid #4acbac">

                <a class="text-white h2" href="">{{crcount}}</a>

                <p class="text-white h4">简历收藏</p>
            </div>
            <div class="col-md-3">

                <a class="text-white h2" href="">{{arcount1}}</a>

                <p class="text-white h4">待筛选简历</p>

            </div>
            <div class="clearfix space-30"></div>
        </div>


        <div class="page">
            <div class="page-content">
                <!--<div class="p-w-sm m-b-sm">-->
                <!--</div>-->
                <!--<div class="clearfix"></div>-->
                <div class="h4">
                    <!--<h3>-->
                    收到的简历
                    <small>(共<span>{{list.length}}</span>份)</small>
                    <!--</h3>-->
                </div>
                <!--<div>-->

                <!--<div class="p-xs colorBg "style="border:1px solid #e8e8e8;">-->
                <!--<div class="i-checks">-->

                <!--<input   id="checkAll"type="checkbox" value="option1" style="position: absolute; opacity: 0;">-->
                <!--全选-->

                <!--<a href="javascript:;" class="btn btn-primary btn-sm m-l-sm" id="resumeRefuseAll">不合适</a>-->
                <!--</div>-->
                <!--</div>-->


                <div class="colorBg p-xs" id="filterBox" style="border:1px solid #e8e8e8;">
                    <dl style=""><input type="hidden" name="defaultCondition" value="true"
                                        id="defaultCondition">
                        <dt class="pull-left">简历状态：</dt>
                        <dd>
                            <a class="p-xxs navy-bg text-white" rel="-1">不限</a>
                            <a rel="1">未阅读</a>
                            <a rel="2">已阅读</a>
                            <a rel="3">已转发</a>

                            <div class="pull-right text-body">更多筛选&ensp;<i class="fa fa-chevron-up text-body"></i></div>
                            <input type="hidden" name="statusFilter" value="-1">
                        </dd>
                    </dl>
                    <dl class="resTrans" style="display:none;">
                        <dt class="pull-left">工作经验：</dt>
                        <dd>
                            <a class="p-xxs navy-bg text-white" class="" rel="0">不限</a>
                            <a rel="1">应届毕业生</a>
                            <a rel="2">1年以下</a>
                            <a rel="3">1-3年</a>
                            <a rel="4">3-5年</a>
                            <a rel="5">5-10年</a>
                            <a rel="6">10年以上</a>
                            <input type="hidden" name="workExp" value="0">
                        </dd>
                    </dl>
                    <dl class="resTrans" style="display:none;">
                        <dt class="pull-left">最低学历：</dt>
                        <dd>
                            <a class="p-xxs navy-bg text-white" rel="-1">不限</a>
                            <a rel="1">大专及以上</a>
                            <a rel="2">本科及以上</a>
                            <a rel="3">硕士及以上</a>
                            <a rel="4">博士及以上</a>
                            <input type="hidden" name="eduCode" value="-1">
                        </dd>
                    </dl>
                    <input type="hidden" id="positionId" name="positionId" value="">
                    <input type="hidden" id="filtera" name="filtera" value="0">
                </div>

                <ul class="resume_lists m-t-sm">

                    <li v-for="item in list">
                        <div class="p-xxs bg-body"><span class="pull-right fontgray ">2016-07-13 16:15<i
                                        class="fa fa-star-o fontgray p-w-sm font18"
                                        @click="collectAction(item)"></i></span>

                            <div class="i-checks ">
                                <input type="checkbox" value="" style="position: absolute; opacity: 0;">
                                <span class="fontgray">应聘：</span>{{item.P_Name}}
                                <span v-show="item.A_Back==0" class="text-body p-w-sm">未读</span>
                            </div>
                        </div>
                        <div class="hr-line-dashed m-b-xs m-t-none"></div>
                        <div class="row" style="height:100px;">
                            <div class="col-xs-7">
                                <a href="" class="col-xs-3" target="_blank"
                                   title="">
                                    <img :src="item.R_Headp" style="background:url(/images/default-icon.png) no-repeat center" width="69" height="69"><!--src=ifHeadp(item.R_Headp)-->
                                </a>
                                <template v-if="status==100">
                                    <a v-show="status==100" href="/post/info/{{item.RID}}?col" target="_blank" class="col-xs-9">
                                        <div class="">
                                            {{item.U_Name}} / {{item.U_Sex}} / {{item.P_Exp}}年 / {{item.R_City}} <i class="fa fa-envelope-o" :class="{ 'text-body': isCollect }"
                                                                                                                    style="padding-left:10px;color:#cacaca;font-size:19px"></i><br>
                                            {{R_Position}} · {{item.C.C_Name}} <br>
                                            天津大学 · {{R_Major}} · {{item.R_Education}}
                                        </div>
                                    </a>
                                </template>
                                <template v-else>
                                    <a href="/post/info/{{item.ID}}" target="_blank" class="col-xs-9">
                                        <div class="">
                                            {{item.U_Name}} / {{item.U_Sex}} / {{item.P_Exp}}年 / {{item.R_City}} <i class="fa fa-envelope-o" :class="{ 'text-body': isCollect }"
                                                                                                                    style="padding-left:10px;color:#cacaca;font-size:19px"></i><br>
                                            {{R_Position}} · {{item.C.C_Name}} <br>
                                            天津大学 · {{R_Major}} · {{item.R_Education}}
                                        </div>
                                    </a>
                                </template>
                            </div>
                            <div class="col-xs-2 full-height text-body text-center" style="border-left:1px dashed #e7eaec;padding-top:36px">
                                <a class="text-body"v-on:click = "contactApplyer(item)"<!--v-on:click ="changeRmStatus(item,3)-->
                                href="/postInfo/{{item.ID}}" target="_blank">
                                 <template v-if="item.A_Back==2||item.A_Back==1">联系他</template>
                                </a>
                            </div>
                            <div class=" col-xs-3 full-height" style="border-left:1px dashed #e7eaec;padding-top:36px">
                                <a class="text-body text-body p-h-m" @click="changeRmStatus(item,5)">
                                    <template v-if="item.A_Back==0||item.A_Back==1||item.A_Back==2||item.A_Back==3">
                                        不合适
                                    </template>
                                </a>
                                <a class="text-body m-l-md"<!--@click="changeRmStatus(item,2)-->">

                                    <span v-show="item.A_Back==1"class="text-body">已查看</span>
                                    <span v-show="item.A_Back==2" @click=""class="text-body">邀请面试</span><!--changeRmStatus(item,3) -->
                                    <span v-show=" item.A_Back==3"class="text-body">已邀面试</span>
                                    <span v-show=" item.A_Back==4"class="text-body">邀请入职</span>
                                    <span v-show=" item.A_Back==5" style="color:gray">不合适</span>
                                    <span v-show=" item.A_Back==6"class="text-body">等待入职</span>
                                    <span v-show=" item.A_Back==7" style="color:gray">拒绝面试</span>

                                </a>
                                <a href="/post/info/{{item.ID}}" @click="changeRmStatus(item,1)" target="_blank" v-show="item.A_Back==0">
                                    <span class="text-body">查看</span>{{item.A_Back}}
                                </a>
                                <a class="text-body pull-right pull-right p-w-sm " href="javascript:;"@click="changeRmStatus(item,0)">
                                    <span class="text-body">删除 </span>
                                </a>
                            </div>
                        </div>
                    </li>

                </ul>
                <div class="hr-line-dashed m-b-xs m-t-none"></div>
            </div>

        </div>
        <div class="text-right"id="pageBtn">
            <button @click="lrPage(true)" class="btn btn-white pageUp" type="button"><i class="fa fa-chevron-left"></i></button>
            <ul class="btn-group m-b-none" >

                 <li v-for="item in pagination" @click="pageId = item"class="btn btn-white":class={'active':item==pageId}>{{item}}</li>
                <!--<li class="btn btn-white  active">2</li>-->

            </ul>
            <button @click="lrPage(false)"class="btn btn-white pageDown" type="button"><i class="fa fa-chevron-right"></i> </button>
        </div>
        <div class="space-30"></div>

    </div>






</div>
</div>

<% include normaljs.ejs %>
</body>
</html>

<script src="../plugins/vue/vue.min.js"></script>

<script>

    var postjl = new Vue({
        el: "body",
        data: {
            search: {},
            list: [],
            arcount: '',
            arcount1: '',
            arcount3: '',
            crcount: '',
            status:<%=status%>,
            rmState: '',
            pagination:[],
            pageId:'1',
            itemCount:'',
            pageCount:'',
        },

        methods: {
            changeRmStatus: function (item, status) {
                var pckey = tools.getCookie('key');
                var arid = item.ID;
                var cid = tools.getCookie('cid')
                var data = {cid: cid, arid: arid, status: status}
                //var _this = this;
                // var data = {key:pckey,arid:1,status:status};
                api.jianli.updarstatus(pckey, data, function (data) {
                    if (data.code == 200) {
                        // item.A_Back = 5;
                      //  item.A_Back = 3;
                    }
                })
            },

            collectAction: function (item) {
                console.log(item);
                var para = {
                    cid: tools.getCookie('cid'),
                    rid: item.ID,
                }
                api.jianli.collectAction(para,tools.getCookie('key'),function(data){
                    if(data.code == -1){
                        alert(data.message);
                    }else{
                        alert(data.messge);
                    }
                })
            },

            renderPostList:function(){
                var para = {
                    cid: tools.getCookie('cid'),
                    pagesize: 20,
                    pageindex: postjl.pageId,
                    status: <%=status%> || 0,
                        }
                if (para.status == 100) {
                    postjl.ifCollectList();
                } else {
                    api.jianli.listbycom(para, tools.getCookie('key'), function (data) {

                        postjl.pageCount = Math.ceil(parseInt(data.messge) / para.pagesize);
                        postjl.itemCount = data.messge;
                        postjl.getPage(postjl.pageCount);

                        postjl.list = data.datas0;
                        postjl.arcount = data.datas1[0].arcount;
                        postjl.arcount1 = data.datas1[0].arcount1;
                        postjl.arcount3 = data.datas1[0].arcount3;
                        postjl.crcount = data.datas1[0].crcount;
                    })
                }
                //ifCollect(item);

            },
            ifCollectList:function() {
                var para = {
                    cid: tools.getCookie('cid'),
                    pagesize: 20,
                    pageindex: postjl.pageId,//
                }
                api.jianli.collectionList(para, tools.getCookie('key'), function (data) {
                    postjl.pageCount = Math.ceil(parseInt(data.messge) / para.pagesize);
                    postjl.itemCount = data.messge;
                    postjl.getPage(postjl.pageCount);

                    postjl.list = data.datas0;
                    postjl.arcount = data.datas1[0].arcount;
                    postjl.arcount1 = data.datas1[0].arcount1;
                    postjl.arcount3 = data.datas1[0].arcount3;
                    postjl.crcount = data.datas1[0].crcount;
                })
            },

            contactApplyer:function(item){
                var cid = tools.getCookie('cid');
                var rid = item.R_ID;
                var pid = item.P_ID ;
                api.getInfo(cid,rid,pid,tools.getCookie('key'),function(data){
                    var a;
                });
            },

            getPage:function(pageCount){
                postjl.pagination = [];
                for(var i=0;i<pageCount;i++){
                    postjl.pagination.push(i+1);
                }
            },

            lrPage:function(tag){
                if(tag){
                    if(postjl.pageId>0){
                        postjl.pageId-=1;
                    }
                }else if(postjl.pageId<postjl.pageCount){
                        postjl.pageId=parseInt(postjl.pageId)+1;
                }
            },

//            ifHeadp:function(R_Headp){
//                if(!R_Headp||R_Headp.length<1){
//                    R_Headp = "/images/default-icon.png";
//                }
//                return R_Headp;
//            }

        }
    })

    postjl.renderPostList();
    postjl.$watch('pageId', function () {
        postjl.renderPostList();
    })



    var ifCollect = function (item) {
        var data1 = {rid: postInfo.postId, cid: tools.getCookie("cid")};
        api.jianli.getRmProperty(data1, key, function (data) {
            postInfo.property.isCollect = data.datas0;
            postInfo.property.isBuy = data.datas1;
            postInfo.property.isInvite = data.datas2;
            postInfo.property.isGetInfo = data.datas3;
            //  postInfo.getinfo.isCollect = data.data4[0];
        });
    }


    var btn = true;
    $(".fa-chevron-up").parent().click(function () {
        if (btn) {
            $(".resTrans").show();
            $(".fa-chevron-up").addClass("fa-rotate-180");
        } else {
            $(".resTrans").hide();
            $(".fa-chevron-up").removeClass("fa-rotate-180");
        }
        btn = !btn;
    });
    $("#filterBox").find("a").mouseenter(function () {
        $(this).addClass("p-xxs navy-bg text-white");
    }).mouseleave(function () {
        $(this).removeClass("p-xxs navy-bg text-white");
    });


</script>


<script>

</script>

<script type="text/javascript" charset="utf-8" src="/js/plugins/iCheck/icheck.min.js"></script>
<script>
    //    $(document).ready(function () {
    //        setTimeout(function(){
    //            $('.i-checks').iCheck({
    //                checkboxClass: 'icheckbox_square-green',
    //            });
    //            ifCheck();
    //            checkAll();
    //        },100);
    //    });

    //    function checkAll() {
    //        var $checkAll =$("#checkAll").next();
    //        $.each($checkAll,function(i,n){
    //            $checkAll.eq(i).click(function(){
    //                if ($(this).parent().hasClass("checked")) {
    //                    $(".resume_lists .icheckbox_square-green").addClass("checked");
    //                    $(".resume_lists input").prop("checked",true);
    //                } else {
    //                    $(".resume_lists .icheckbox_square-green").removeClass("checked");
    //                    $(".resume_lists input").prop("checked",false);
    //                }
    //            });
    //        });
    //    }
    //
    //    function ifCheck(){
    //        var $checkBox = $(".resume_lists ins");
    //        $.each( $checkBox, function(i, n){
    //            $checkBox.eq(i).click(function(){
    //                checkState();
    //            })
    //        });
    //    }
    //
    //    function checkState(){
    //        var len = $(".resume_lists .icheckbox_square-green").length;
    //        var len2 = $(".resume_lists .checked").length;
    //
    //        if(len==len2){
    //            $("#checkAll input").prop("checked",true);//
    //            $("#checkAll").parent().addClass("checked");
    //        }else{
    //            $("#checkAll").parent().removeClass("checked");
    //            $("#checkAll input").prop("checked",false);
    //        }
    //    }


</script>
